@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Serif SC', 'KaiTi', '楷体', 'STKaiti', serif;
  line-height: 1.6;
  color: #2c3e50;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* 中文字体样式 */
.font-chinese {
  font-family: 'Noto Serif SC', 'KaiTi', '楷体', 'STKaiti', serif;
}

.font-ancient {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', 'KaiTi', '楷体', 'STKaiti', serif;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.8;
}

/* 诗词文本样式 */
.poem-text {
  font-family: 'Noto Serif SC', 'KaiTi', '楷体', 'STKaiti', serif;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 2.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
  color: #2c3e50;
}

/* 背景叠加诗句样式 */
.poem-overlay {
  font-family: 'Noto Serif SC', 'KaiTi', '楷体', 'STKaiti', serif;
  font-weight: 500;
  letter-spacing: 0.15em;
  line-height: 1.8;
  text-shadow: 
    2px 2px 8px rgba(0,0,0,0.9),
    0 0 20px rgba(0,0,0,0.7),
    0 0 40px rgba(0,0,0,0.5);
  color: #ffffff;
  position: relative;
  backdrop-filter: blur(1px);
}

.poem-overlay::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.3) 0%,
    rgba(0,0,0,0.1) 50%,
    transparent 80%
  );
  border-radius: 20px;
  z-index: -1;
  pointer-events: none;
}

/* 情绪标签背景叠加样式 */
.emotion-overlay {
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.4) 0%,
    rgba(0,0,0,0.2) 100%
  );
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

/* 动画效果 */
@keyframes poemFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes emotionSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-poem-fade-in {
  animation: poemFadeIn 1.2s ease-out forwards;
}

.animate-emotion-slide-up {
  animation: emotionSlideUp 0.8s ease-out 0.6s forwards;
  opacity: 0;
}

/* 通用动画类 */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

.animate-bounce-gentle {
  animation: bounceGentle 2s infinite;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceGentle {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .poem-text {
    font-size: 0.9em;
    letter-spacing: 0.08em;
    line-height: 2;
  }

  .poem-overlay {
    font-size: 0.8em;
    letter-spacing: 0.1em;
    line-height: 1.6;
    text-shadow: 
      1px 1px 6px rgba(0,0,0,0.9),
      0 0 15px rgba(0,0,0,0.7);
  }
}

/* 自定义组件样式 */
.poem-display {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.ancient-title {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
